var layerId;
var clickState = true;
$(function(){
	$("#save-button").click(function(){
		var parentId = $("select[name='parentId']").val();
		var name = $("input[name='name']").val();
		var sceneId = $("input[name='sceneId']").val();
		if(name.length == 0){
			layer.msg("请输入场景名称");
			return false;
		}
		if(parentId.length==0){
			layer.msg("请选择上级分类");
			return false;
		}
		var sceneData ={
			"id":sceneId,
			"name":name,
			"parentId":parentId
		}
		if(clickState){
			clickState =false;
			$.ajax({
				url:basePath+"/groupScene/save.shtml",
				data:sceneData,
				type:"post",
				dataType:"JSON",
				success:ajaxSuccessCloseFun
			});
		}
	});
	$("#close-button").click(function(){
		parent.closeLayer(0);
	});
	
});